/*
 * masterGetCycleSensor.h
 *
 *  Created on: 27/nov/2009
 *      Author: Aleph3
 */

#ifndef MASTERGETCYCLESENSOR_H_
#define MASTERGETCYCLESENSOR_H_
#include "masterCycle.h"
#include "utilities.h"
//segnali
#define ON_NOTIFY_MASTER_SENSOR_START_PACKET 5
#define ON_NOTIFY_MASTER_SENSOR_ACK_PACKET 6
#define ON_NOTIFY_MASTER_SENSOR_FAIL 7
extern Event masterPutCycleHostInitEvent;
//Notificatori
void NotifyMasterCycleGetSensorStartPacket(void* target);
void NotifyMasterCycleGetSensorGetAckPacket(void* target);
void NotifyMasterCycleGetSensorFail(void* target);
//Stati
StateOutcome masterGetCycleSensorInitTransactionState (void* me,const Event* e);
StateOutcome masterGetCycleSensorPacketSendingState (void* me,const Event* e);
StateOutcome masterGetCycleSensorEndTransactionState (void* me,const Event* e);
StateOutcome masterGetCycleSensorFinishFailState (void* me,const Event* e);
//transizioni
void fromSensorGetPacketSendingStateToSensorGetPacketSendingState(void* me);
void fromSensorGetInitStateToSensorGetPacketSendingState(void* me);
//Inizializzatore Trasmissione
void masterSensorGetCycleHostInit(void* me,void* canPort, uint32_t msgId, uint8_t msgPayloadSize, uint8_t* msgPayload, uint32_t msgAnswer, Notifier onOk);
//tipo supporto evento init
typedef struct{
	uint16_t pPacket;
	void* contentBuffer;
} initSensorGetData;

#endif /* MASTERGETCYCLESENSOR_H_ */
